/**
 * 
 */
package com.axxc.jpa.service;


import java.io.Serializable;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.Specification;

import com.axxc.jpa.repository.IStudentCrudRepository;

/**
 * @ClassName: AbstractStuentService
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author 熊小川
 * @date 2018年5月13日 下午5:54:19
 * @See
 */
@Transactional
public abstract class AbstractStuentCrudService<M, E, ID extends Serializable> implements IStuCrudService<M, ID> {

	@Autowired(required = false)
	private IStudentCrudRepository<E, ID> studentCrudRepository;


	@Override
	public Long count(M model) {
		return this.studentCrudRepository.count(this.toFilter(model));
	}
	

	protected abstract Specification<E> toFilter(M model);
}
